<& blognav.mas, storyId => $id, page => $header &>
% if ($ipAccess) {
EDIT
% }
<% $dateCreated %>

% if ($author) { by <% $author %>

% } % if (($status) or (($ipAccess) and (!$status))) { <% $copy %>
% }
<%init> my ($sql, $sth); my $dbh = $m->comp('/dbconnect.mas'); ## DETERMINE IF ACCESS IS ALLOWED FROM ADAGIO EMPLOYEE IP my $ipAccess = $m->comp('../../adagio/lib/ip_access.mas', page=>'blog_lardera'); ## WHITELIST SEO CONSULTANT IP if ($ENV{'HTTP_X_FORWARDED_FOR'} eq "188.78.244.196") {$ipAccess = 1;} my $id = $ARGS{id}; if (index($id, '/')>0){ $id = substr($id, 0, index($id, '/')); } $sql = qq| SELECT ID, ID_NICE, DATE_FORMAT(DATE_CREATED, '%M %d, %Y'), IMAGE, HEADER, TEASER, COPY, AUTHOR, AUTHOR_LINK, STATUS FROM blog_lardera WHERE ID = ? LIMIT 1 |; $sth = $dbh->prepare($sql); $sth->execute($id); my ($bid, $bidnice, $dateCreated, $image, $header, $teaser, $copy, $author, $authorLink, $status) = $sth->fetchrow_array(); if (index($ENV{'QUERY_STRING'}, '/') == -1 && length($bidnice)>1){ my $newUrl = "/blog/$bid/$bidnice"; $m->clear_buffer; # set the HTTP status to 301 $r->status(301); # set the Location header to your target URL $r->headers_out->add( Location => $newUrl ); # tell Mason to finish the request and return that status return 301; } $copy =~ s/\n/
/g; $copy =~ s/h(\d)>.{1}
/h$1 class="titlepadding">/g; $copy =~ s/

/

/g; ## IMAGE $copy =~ s//
<\/div>

<\/div>/g; $copy =~ s/

<\/div>.{1}
.{1}
/

<\/div>/g; ## IMAGE & CAPTION $copy =~ s//
$1<\/div><\/div>

<\/div>/g; ## IMAGE SIDE $copy =~ s//
<\/div>/g; ## IMAGE - MULTIPLE $copy =~ s//
<\/div>

<\/div>/g; $copy =~ s//
<\/div>

<\/div>/g; $copy =~ s/

<\/div>.{1}
.{1}
/

<\/div>/g; ## IMAGE - MULTIPLE & CAPTION $copy =~ s//
$2<\/div><\/div>

<\/div>/g; $copy =~ s//
$2<\/div><\/div>

<\/div>/g; <%attr> title => 'WEBSITE_NAME - Blog'